<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../base.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>正达建筑设计院图纸管理系统</title>
</head>

<body>
<div id="frameContent" class="content-wrapper" style="margin-left:0px;">
    <section class="content-header">
        <h1>
            图纸管理
            <small>图纸信息管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="all-admin-index.html"><i class="fa fa-dashboard"></i> 首页</a></li>
        </ol>
    </section>


    <section class="content">
        <div class="box-body">
            <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li class="active">
                        <a href="#tab-form" data-toggle="tab">添加图纸信息</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <form id="editForm" action="${ctx}/draw/save" method="post" enctype="multipart/form-data">
                        <div class="tab-pane active" id="tab-form">
                            <div class="row data-type">

                                <div class="col-md-2 title">上传图纸</div>
                                <div class="col-md-4 data">
                                    <input type="file" class="form-control" placeholder="图纸地址" name="durl" value="${draw.durl}">
                                </div>

                                <div class="col-md-2 title">图纸信息</div>
                                <div class="col-md-4 data">
                                    <input type="text" class="form-control" placeholder="图纸信息" name="info" value="${draw.info}">
                                </div>

                                <div class="col-md-2 title">归档时间</div>
                                <div class="col-md-4 data">
                                    <div class="input-group date">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" placeholder="归档时间" name="filing_time" class="form-control pull-right"
                                               value="${requestScope.draw.filing_time}" id="datepicker">
                                    </div>
                                </div>

                                <div class="col-md-2 title">负责人</div>
                                <div class="col-md-4 data">
                                    <select class="form-control"
                                            onchange="document.getElementById('name').value=this.options[this.selectedIndex].text"
                                            name="user_id">
                                        <option value="">请选择</option>
                                        <c:forEach items="${userList}" var="item">
                                            <option ${requestScope.draw.user_id == item.id ?'selected':''}
                                                    value="${item.id}">${item.name}</option>
                                        </c:forEach>
                                    </select>
                                </div>

                                <div class="col-md-2 title">所属类别</div>
                                <div class="col-md-4 data">
                                    <select class="form-control"
                                            onchange="document.getElementById('type_name').value=this.options[this.selectedIndex].text"
                                            name="type_id">
                                        <option value="">请选择</option>
                                        <c:forEach items="${typeList}" var="item">
                                            <option ${requestScope.draw.type_id == item.id ?'selected':''}
                                                    value="${item.id}">${item.type_name}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="box-tools text-center">
            <button type="button" onclick='document.getElementById("editForm").submit()' class="btn bg-maroon">保存</button>
            <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
        </div>

    </section>

</div>


</body>


<script src="${ctx}/plugins/datepicker/bootstrap-datepicker.js"></option>
    <script src="${ctx}/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
  <link rel="stylesheet" href="${ctx}/css/style.css">
    <script>
      $('#datepicker').datepicker({
      autoclose: true,
      format: 'yyyy-mm-dd'
    });
      $('#datepicker1').datepicker({
      autoclose: true,
      format: 'yyyy-mm-dd'
    });
</script>


</html>